<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>书籍管理</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery-3.3.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>
<body>
<table class="table table-striped table-dark" style="width: 80%;margin: 0px auto;">
    <thead>
    <tr>
        <th scope="col">书名</th>
        <th scope="col">作者</th>
        <th scope="col">价格</th>
        <th scope="col">销量</th>
        <th scope="col">库存</th>
        <th scope="col">图片</th>
        <th scope="col">操作</th>
        <th scope="col"></th>
    </tr>
    </thead>
    <div1 id="tbody1">
    <input type="submit" @click="books">

           {{ obj1 }}
    </div1>
</table>


<script>
    new Vue({
        el: "#tbody1",
        data: {
            obj1: null,
        },
        methods:{
            books:function () {
                var that=this;
                axios.post("http://localhost:8080/books")
                    .then(
                        function (ans) {
                            that.obj1=ans.data;
                        },function (err) {
                            alert(err)
                        }
                    )
            }
        }
    })
</script>
</body>
</html>